package learn.particleSys;

import java.util.ArrayList;

import processing.core.PApplet;
import processing.core.PVector;

public class SystemOfSystem extends PApplet {
	public static void main(String[] args) {
		PApplet.main(new String[] { "--present", "SystemOfSystem" });
	}


	ArrayList<ParticleSystem> systems;
	
	public void setup() {
		size(640, 360);
		systems = new ArrayList<ParticleSystem>();
	}

	public void draw() {
		background(255f);
		for (ParticleSystem ps : systems) {
			ps.run();
			ps.addParticle();
		}

		fill(140);
		text(" Click mouse to add particle systems ", 10, height - 30);
	}

	public void mousePressed() {
		systems.add(new ParticleSystem(this, new PVector(mouseX, mouseY)));
	}
}
